using System;
using System.Collections.Generic;
using System.Text;

namespace SqlToolkit.Oracle.Schema
{
    public class SqlDbTableCollection :SqlToolkit.SqlDataObjectCollectionBase
    {
        #region Construction
        public SqlDbTableCollection() { }
        #endregion
        #region Add
        public int Add(SqlDbTable value)
        {
            return base.Add(value);
        }
        #endregion
        #region IndexOf
        public int IndexOf(SqlDbTable value)
        {
            return base.IndexOf(value);
        }
        #endregion
        #region Insert
        public void Insert(int index, SqlDbTable value)
        {
            base.Insert(index, value);
        }
        #endregion
        #region Remove
        public void Remove(SqlDbTable value)
        {
            base.Remove(value);
        }
        #endregion
        #region Indexer
        new public SqlDbTable this[int index]
        {
            get { return (SqlDbTable)base[index]; }
        }
        #endregion

        public SqlDbTable GetTable(string tableName)
        {
            if (this.Count < 1) { return null; }

            foreach (SqlDbTable tbl in this)
            {
                if (tbl.TableName.ToUpper().Trim() == tableName.ToUpper().Trim())
                {
                    return tbl;
                }
            }

            return null;
        }
    }
}
